<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>创建和手动提交表单</title>
	</head>
	<body>
		<script>
			let form = document.createElement('form')
			form.action = 'https://google.com/search'
			form.method = 'GET'

			form.innerHTML = '<input name="q" value="test" />'

			// 表单必须在文档中才能提交
			document.body.append(form)

			form.submit()
		</script>
	</body>
</html>
